comment and fix minor bugs