A vehicle tracking algorithm