added register function and updated docs