Switching machines