Added some documentation, did some minor cleanup