Added a number of changes to implement user profiles