Added documentation + minor improvements