fixed bug in polygon output