fixed up some user and goal code and added more tests