Added command line argument for specifying the number of iterations.
Changes for linux. Might screw up windows!