Prediction engine in c, c++