fix bug and done work
conflict merge
Merge pull request #163 from dkonurov/master

fix bugs and conflict merge