Cleaned up the create new user code a bit, added comments.