Adding some documentation and general cleanup