sample polygon code