more work on the prediction code