Added debug output, command line argument parsing...