normalizing grid coordinates