Rectangles optimization task + UI