Updated the random graph utility function and added comments, additionally added Ms to make code a bit more logical