tests for issue #39. and some pep8 fixes
Merge pull request #70 from sashakruglov/issue_39

tests for issue #39. and some pep8 fixes