edited docstrings and replaced np.arange with range