initial (but broken) implementation of the bounding box stuff