Added rectangle drawing to the cpp version