not using the derivative approach anymore