Removed a debug message
Removed some debug variables
Refactoring: extracted some general geometry/polygon methods