added comments, added try/catch for registrations