Got Brandes algorithm working again