Reset all arrays after a file has been created so that second files are not added to the first