implemented some of the profile code