Add assert_equal function
* clean up compute_deriv