Add templates and modify solution