Update PolyGrid.m

Will now write the new .poly files to the desk. Minor tweaks in sub-functions as well.