finish implementation of drawing polygon