Improved run speed, weird issue with output to file