implemented model template
in the middle of getting templates to work