existing track validation code from Boris