added part of tests + refactoring, see #1
change version to 1.0.7