improve prediction algorithm