Better synchronizing, fix min distance