Added documentation, cleanup