created new functions and added registrationCode

registrationCode user story 82584526.
Fixed some bugs