Added register function.