implemented quantity tracking