implemented more methods in MyGraph