Code cleanup; generate graphs