implemented tuning and prediction