changed to look for quantity instead of live flag