final tweaks to algorithm, letting it run on gemini1
adding a cli option parser