changed the way polygon center is calculated