switched completely to lapply in resample_grid() internals