updated algoritm and checking of input data
search cycle code
Merge pull request #1 from PeterAbramov888/dev_update_algoritm

Dev update algoritm