in less than two years he transformed the country by organizing the soldiers into strategically located garrisons , breaking up the slave trade , and setting up relations with the neighboring ugandan king .