writing function to parse options into a list