tweaks to gridop code