messing around with graph algorithms