refactored a few things, more documentation; yay