Added documentation and cleaned up a little
Cleanup from comparison from master