In your code, it is not possible for Pluto to detect cell dependencies because all functions work by implicitly modifying the global track variable.
To make Pluto aware of the dependencies, use a more functional approach, i.e. track2= Map(track), where Map takes their inputs as parameters and return the values they modified.
The initialization of track and Line are probably fine because they define / only read the track variable.