fixed a speed issue with overlap checking, best_state vs edge_best