fixed lasthash.txt function for reals