Code from what I had so far.

Started this on my own PC. Just a few bugs here and there.