adjusted algorithm to support when a full track is not possible