added homework2 after creating random graph