fixed while template parsing. added templates example