refactoring polygon and adding array test