add documentation & cleanup