Added documentation and sent correct parameters to the 'doRegister' function