Fixed bug in tdm code. Verified for small/large datasets
Fixed bug in tdm code. Verified for small/large datasets

vtsynergy/OpenDwarfs,opendwarfs/OpenDwarfs,opendwarfs/OpenDwarfs,pyrovski/OpenDwarfs,vtsynergy/OpenDwarfs,opendwarfs/OpenDwarfs,vtsynergy/OpenDwarfs,pyrovski/OpenDwarfs,pyrovski/OpenDwarfs