refactoring and fix result values
Merge pull request #6 from PeterAbramov888/dev_update_algoritm

refactoring and fix result values