Added documentation

Added some explanations as to what is going on inside of the code.

TODO: Figure out how to make the UDS reduction smoother.