passed all test cases on Anonymous Methods