finished all the template mess