Added the register function.