Made some of the code look a little more like C# and a bit less like Java.