Added Register function.