implemented all derivatives, still needs checking