recoded algorithm with repeater, removed Rect.qml and RectHighlight.qml