Tweaked the algorithm

Predicting 5 steps ahead and handling random numbers appearing