Added fold and map to traverse the IR