Found the bugs in the derivatives :))))))