 	if (index >= docs) return;
 
 	int myDocId = index;
-	//printf("doc %d has norm %4.4f\n", myDocId, docsNorm[myDocId]);
 	docScores[myDocId] = 0;
 	int i;
+
 	Posting termPosting;
-	//printf("query terms: %d\n", querySize);
 	for (i = 0; i < q.size; i++) {
 		termPosting = postings[q.termsId[i]];
 		//printf("term %d has %d docs.\n", q.termsId[i], termPosting.docsLength);

		} while(currentDocId < myDocId && docIdsPos < termPosting.docsLength - 1);
		if (myDocId == currentDocId) {
			//printf("found my doc id: %d\n", currentDocId);
			//printf("doc %d: weight to sum: %4.2f\n", myDocId, termPosting.weights[docIdsPos]);
			docScores[myDocId] += termPosting.weights[docIdsPos];
			//printf("doc %d: current weight: %4.2f\n", myDocId, docScores[myDocId]);
		}
	}
}

int main(int argc, char const *argv[]) {

	cudaEventCreate(&resolveQueryStop);
  int i;
	Query q = parseQuery(queryStr);

	float *docScores, *dev_docScores;
	int BLOCK_SIZE = 1024;
	int numBlocks = (docs + BLOCK_SIZE - 1) / BLOCK_SIZE;

	printf("Sending docs scores to GPU\n");
	docScores = (float *) malloc(sizeof(float) * docs);
  cudaMalloc((void **) &dev_docScores, docs * sizeof(float));

	printf("Sending query to GPU\n");
	int* dev_termsId;
	float* dev_weights;
	cudaMalloc((void**) &dev_termsId, sizeof(int) * q.size);
	cudaMalloc((void**) &dev_weights, sizeof(float) * q.size);
	cudaMemcpy(dev_termsId, q.termsId, sizeof(int) * q.size, cudaMemcpyHostToDevice);
	cudaMemcpy(dev_weights, q.weights, sizeof(float) * q.size, cudaMemcpyHostToDevice);
	q.termsId = dev_termsId;
	q.weights = dev_weights;

	cudaEventRecord(resolveQueryStart);
	k_resolveQuery<<<numBlocks, BLOCK_SIZE>>>(
