Use accessor methods to set and get private members

http://ideone.com/zGwg4G