passed all test cases on Nested Types