refactored some graph functions, added 1 graph ds question