minor fixes
add graph simplifying