Implemented getCost method
Implemented the addEdge method, got some weird error
Simplified addEdge method
Trying to optimize
Changed methods to use referencing
This should work but doesn't
fixed error and answered my own question