implementin refinement for the grid in ratran, uglish implementation that works