Adding some better documentation and cleaning up...