improving prediction algorithm