added registration function

allows new users to register and login