updated graph class
made everything public