mapAccumL implemented. Will be needed for PrintStm