Fixed edge case in drawpolygon from assignment 2