Added outputfile and changed according