done with assignment. move function to model. start working on validation