Data file is now written, but only contains the first line (last line if
move std::ofstream dataFile(dataFilename.c_str()); to the writLine
function)