add basic test case and cleanup polygon generation