added option -v (verbose) and -t (test)