Added better command line parsing, and an example