add outputfile handeling