Fixed bug causing overlapping nodes, and another that caused the output not to actually match the best solution found so far