Added a versioning parameter for the main. Allows us to toggle between
which version of the algorithm is being used. Defaults to version 2 if
there is no second argument or if the second argument is invalid.