added code to analyze the distance of bounding boxes of strokes
code readability and minor bug