Added weights to the graph and made sure that it still searches correctly