changed parameter order of calc_grid(). refined docstrings.