Added output file stuff