fix of algorithm
+ refactoring