got the rect() plotting working finally