TLD.cpp original version