Implemented register function