Changed to a more reliable way of referencing the input file