rus comments added, some refactoring