added additional functionality to register

Added additional functionality to register. A couple of bugs that needs
to be fixed still.