refactoring the prediction array