code is converging on solution however there is some oscillation