implemented half-stack for polygon list