Edited main to use fileWriter. Edited add function to output an int array as well for file writing.