added derivative term to minimize error