changed code to output to precition.txt as per piazza comment from chris.