changed  to protected and added get/set methods, modified code to use get/set methods