implementing polygon