used memory should be using class variable as well