Made it so that it builds the string tree at each query