available memory and change type was not using class variables