remixed from Emerson's project. use a proper 'track_mode' variable to control forward (track_mode=1, default) and backward tracking (track_mode=0). also fixed the toggle button bug for track mode switching.