added graph method

comments in test main