writing some implementation code for model methods