made algo ready for demo so it can now accept file inputs from command line