speedup grid result calculation