Updated function "get_z_k"

Also included the usage of package "numDeriv" for evaluating the derivatives