graph and bug fixed