updated gradient test.