clearer code in selection-rect