Few changes

change public attributes to private and change code in function of it