Fixed function names, and added documentation in template file