my code working, with algorithm choice as a command line option