fix minor bugs and add some inputs