Created crossvalidation query generator. Flattened return list for threshold.py.