fixed numerical gradient

big error patched in gradient.m