made some changes in prediction method