deduplicate first
correct detail outout
flush any writes to file
change usage message
add log file support