Okay thats kinda silly.
Good spot chris... in fact when I re-uploaded for some reason I attached the old one.
The risk of working on two computers???? [my excuse]
I've changed the attachment to prior post and will also add it here.
Some notes: M.floor the x2 z2 was already done although it is largely redundant as calculations made using them are subsequently rounded or floored. I had done it anyway just to be obs-comp.
In fact the error ss was having was bec. I didn't have something to cover for a tile size that was odd.
So in that case such as his inputs when midpoint was calc it gave something .5
That was the main thing corrected in this revision which you hopefully should have, actually have this time