Documentation

Documented code. Look it over closely, this code was a little harder to
comprehend because of how it was structured so pay close attention to
the mistakes I probably made.