switched from using direct access to the variables to using setters