add -m switch, fix typos and formatting issues