changed box finding algorithm to walking the edge saving corners as we go