adds functions and testing to User model