 {
 	free(HostMem->Rd_xy);
 	free(HostMem->Tt_xy);
+	free(HostMem->time_xyt);
+	free(HostMem->tdet_pos_x);
+	free(HostMem->tdet_pos_y);
 	free(HostMem->fhd);
 	free(HostMem->thread_active);
 	free(HostMem->num_terminated_photons);

	const int num_y=(int)(4*(sim->esp)*(double)sim->grid_size);
	const int num_z=(int)((sim->esp)*(double)sim->grid_size);
	const int fhd_size = num_x * num_y * num_z;

	// Allocate p on the device
	CUDA_SAFE_CALL( cudaMalloc((void**)&DeviceMem->p,NUM_THREADS*sizeof(PhotonStruct)) );

	cudaFree(DeviceMem->p);
	cudaFree(DeviceMem->Rd_xy);
	cudaFree(DeviceMem->Tt_xy);
	cudaFree(DeviceMem->time_xyt);
	cudaFree(DeviceMem->tdet_pos_x);
	cudaFree(DeviceMem->tdet_pos_y);
	cudaFree(DeviceMem->fhd);
	cudaFree(DeviceMem->bulk_info);
	cudaFree(DeviceMem->x);
