Added some documentation/cleaned up