Cleanup, documentation, commenting