this loop makes the last unit state win. It should break as soon as one of them is not up to date