removing bad graphs