reimplemented rectangle
merged