Changed variable access and added getter methods.