Fixed bug in the createGraph method

And I hopefully improved the createPacked method