fit to template