add tp + some minor bug correction