the register function