completed the random graph generator