sorting rects from left to right