Added some documentation, cleaned some shit up