Added register code and User class