added options parsing code