trying to find the solution to the polygon=line problem