cleanup
graph/for loop  refactoring