add verbose option and some improvements