graph clean up