fixed bug for odd gridres