added the second method and tested with the view graph class