Added code from work computer

I'll be able to start work on this at home now.