add parseoptions and checkinput