started rewriting polygon conversion functions