refactor out options parsing
Fix problem and up version