fix grid calculations to match new reality in util/