tried to make the inputfiles foolproof