refactored: in doOperation in every if added break because Test showed that can be added in 1 loop 2 times