Refactoring polygon

Cleaning up of the polygon class