finished system for extracting program options