Added templates and javascript