added more debug lines to write_gpx