Improvements, moar comments, neater code.

Now remember kids, always comment your code!