Initial work on queryByThreadID