Changed script to take the directory as a command-line argument
changed the name of the counter so that it will print the correct loop as it is doing it.