Worked out how to pass variables through to the templates