changed the name of the variable to flags from i
added another constructor and changed Boolean to boolean type
cleaned up some code, changed a method name to more meaningful and extracted out method createUserFromJSON