add tests, fix PEP8