Added profiles and updted a function