doc update for templating and a better sample program