Working version with bounding boxes
Improved just about everything...