Problem with graph generation