minor cleanup; add some comments