added some protection for instance variables and then used the getter and setter methods instead of accessing the variables directly in driver class