lots of experimental code
important fix in get_track_to_tracks