Wrote / tested write to file function.