more robust path finding for output directory, adding command line arguments to script for specifying file and attr type