implemented response function numerically