some tests for polygon construction
export polygon and fix edge case in polygon pairing