Edited readme and sample file to mention about the returned-by-function value as the third parameter for the template.