added more prediction code