slight modification to single frame script that includes parent directory in file name