Completed output functionality, writing to file and writing to screen