added fflag, hflag and moved usage function before main