update for arbitrary grid settings