function simulates creation of bounding box between 2 points