Added some documentation and reorganization.