tracks.py: working on sliding window algorithm.