fixing file writing, corrected file naming to correspond to input binaries