fix test in main and toGrph