Initial thread code
Hopefully it works on rlogin because I'm getting a weird error on my Mac