passed all test cases on Classes