this is the object detection script that actually works