Simplified track_length() function. (thanks ruaok)