fixed tests, improved code with pylint