Added register functionality.