Affirmative and negative
| 
       I/you/he/she/it/we/they  | 
    
       had (not)  | 
    
       visited the town before.  | 
	
Question
| 
       Had  | 
					 I/you/he/she/it/we/they  | 
		
       visited the town before?  | 
	
The past perfect is used to talk about events and states that happen before a moment in the past.