added flag instructions, fixed checking if output is dir