fixed object detection and added basic counting, still need to make the counting robust