implemented the ability to pass variables to sub-templates
changed echo to return