order modes correctly