fixed minor bug in wasteCount