minor edits on profile function