using homework2 as a template