Right now we are repeatedly opening and closing the file, but that does not over write the file. It just appends.