adding dirname, fixing filename so it contains the full path and file extension, updating example files to spit out the filename and dirname for debugging