Register code working