trying to optimize maxTs-search