graph is all tested and working and slightly modified the connection class