Update loading and writing of 'last.txt' file