Grmph... now fixing the code for real; it was overwriting the input file