Finished most of square/rectangle.  Needs further testing and formatting of answer.