passed tests
added type checking, python3 suport