How could the locomotives run on four speed levels?