trying to solve task with polygon