modify predict method

change algorythm
Merge branch 'work'