improved template with suggestions from Tony