getUserData and addUserData functions added. Other bug fixes and updates