added bounding box distance measure
smoother file writing using threaded queue model