fixed wrong derivatives