organized main program file, proper option checks