Added some controller functions, a template