bugfix #3 and refactoring
merge bugfixing into master
Merge pull request #1 from zmajstor/bugfixing

Bugfixing