implement the predictive function