reviewed all test cases; edited for PEP8