Changed the register function to use the newly created PasswordCodes