Code for processing user profile data. not tested