added parsing and validating options