rewrote adding a user to table, cleanup, helper functions