write_track.e function