add debug option, rename output file