Changed the return value of my second function as it still returned for the prior value and was giving me the wrong results.