fix sign up code and add comments