added templates and a few other things