You must write to file using binary format (int, double)