fixed some bugs, and added verbose option