Added numerical differentiation implementation