handle not NULL file pointer
update README
use better logs
cleanup main.c and add getopt parameters