Changed inputs to be 3 lists of 3 rather than 9 individual integers.
Changed 'r+' to 'w+', fixing the bug previously preventing text files to be opened.