numpy gradient method

it works much better damn it