fix some bug
refactoring code
Merge branch 'salidinov2'