Completed most of the options parsing