multiple-socks: Shutdown now working, but code is messy