Refactored the object detection code to use structs. Previous code still in place.