Added code for registerUser functionality.