some optimization changes. work on the prediction calcs.