ast works for all test cases