Added printing the edges and improved hash function.