        req.onsuccess = () => resolve(req);
		        req.onerror = (err) => reject(err);
		    });
		}

		function fetchResults(cursor, isDone, resultMapper) {
		    return new Promise((resolve, reject) => {
		        const results = [];
		        cursor.onerror = (event) => {
		            reject(new Error("Query failed: " + event.target.errorCode));
		        };
		        // collect results
		        cursor.onsuccess = (event) => {
		        	console.log("got a result");
		            const cursor = even