modifying the algorithm to generate samples according to most frequent numbers in the last 5 results