Only need to traverse upper triangular portion of adj matrix since it is symmetric. Changed a for loop.