now it works even better polygon