changing the grad methode, so it does not return None if only one dim == 1
adding the new grad func
Fixing the test issues for grad, changing few things in functions