add debug option, fix some formatting