work in progress, completed basic template processing for program