Implemented and tested the rectangle shape.
Cleaned up and added some comments