could be done when looking for the leadout track. Revised code to removes these routines, consolidating the searching in one loop. To be *very* conservative, a first loop finds the positions of the leadout, first track and last track. This code then doesn't assume that the track numbers are in order. They could be given track 3, 2, and then 1 or 2, 3, and then 1. Another loop then maps first_track..last_track 0..number_of_tracks - 1