Writing moveHistory to file