templates in progress.  introduced some bugs