Added function to get degree distribution