diff --git a/asterix-app/src/main/resources/sdk/static/cherry/js/cherry.js b/asterix-app/src/main/resources/sdk/static/cherry/js/cherry.js
index b3a8f62..0e35865 100755
--- a/asterix-app/src/main/resources/sdk/static/cherry/js/cherry.js
+++ b/asterix-app/src/main/resources/sdk/static/cherry/js/cherry.js
@@ -1,5 +1,8 @@
 $(function() {	
-	   
+	
+	// Connection to AsterixDB   
+	var A = new AsterixDBConnection().dataverse("twitter");
+	
     APIqueryTracker = {};
     drilldown_data_map = {};
     drilldown_data_map_vals = {};
@@ -225,55 +228,48 @@
         };
 
 		var build_cherry_mode = "synchronous";
-		if ($('#asbox').is(":checked")) {
-		    build_cherry_mode = "asynchronous";
-		}
+		
+		// FIXME
+		//if ($('#asbox').is(":checked")) {
+		//    build_cherry_mode = "asynchronous";
+		//}
 	
         var f = new FLWOGRExpression()
-            .bind(new ForClause("$t", null, new AQLClause().set("dataset TweetMessages")))
-            .bind(new LetClause("keyword", new AQLClause().set('"' + formData["keyword"] + '"')))
-            .bind(new LetClause("region", new AQLClause().set(temporary_rectangle(formBounds))))
-            .bind(new WhereClause(new AExpression().set(
-                [
-		            'spatial-intersect($t.sender-location, $region)',
-		            '$t.send-time > datetime("' + formData["startdt"] + '")',
-		            '$t.send-time < datetime("' + formData["enddt"] + '")',
-		            'contains($t.message-text, $keyword)'
-                ].join(" and ")
-            )))
-            .bind(new AQLClause().set("group by $c := spatial-cell($t.sender-location, create-point(24.5,-125.5), " + formData["gridlat"].toFixed(1) + ", " + formData["gridlng"].toFixed(1) + ") with $t"))
-            .bind(new ReturnClause({ "cell" : "$c", "count" : "count($t)" }));
+            .bind(new ForClause("$t", new AExpression().set("dataset TweetMessages")))
+            .bind(new LetClause("$keyword", new AQLClause().set('"' + formData["keyword"] + '"')))
+            .bind(new LetClause("$region", new AQLClause().set(temporary_rectangle(formBounds))))
+            .bind(new WhereClause().and(
+                new AExpression().set('spatial-intersect($t.sender-location, $region)'),
+                new AExpression().set('$t.send-time > datetime("' + formData["startdt"] + '")'),
+                new AExpression().set('$t.send-time < datetime("' + formData["enddt"] + '")'),
+                new AExpression().set('contains($t.message-text, $keyword)')
+            ))
+            .bind(new GroupClause(
+                "c", 
+                new AExpression().set("spatial-cell($t.sender-location, create-point(24.5,-125.5), " + formData["gridlat"].toFixed(1) + ", " + formData["gridlng"].toFixed(1) + ")"),
+                "with", 
+                "t"
+            ))
+            .ReturnClause({ "cell" : "$c", "count" : "count($t)" });
         
-        var extra = {
-            "payload" : formData,
-            "query_string" : "use dataverse twitter;\n" + f.val()
-        };
+        param_placeholder["payload"] = formData;
+        param_placeholder["query_string"] = "use dataverse twitter;\n" + f.val();
         
-        f.run(
-            "http://localhost:19002/query",
-             {
-                "query" : "use dataverse twitter;\n" + f.val(),
-                "mode" : build_cherry_mode // "synchronous"
-             },
-             {
-                "sync" : cherryQuerySyncCallback,
-                "async" : cherryQueryAsyncCallback
-             },
-             extra
-        );
-        
+        A.run(f.val(), cherryQuerySyncCallback);
+    
 		APIqueryTracker = {
 		    "query" : "use dataverse twitter;\n" + f.val(),
 		    "data" : formData
 		};
 		
-		$('#dialog').html(APIqueryTracker["query"]);//.replace("\n", '<br />'));
+		$('#dialog').html(APIqueryTracker["query"]);
 
-        if (!$('#asbox').is(":checked")) {
-		    $('#show-query-button').attr("disabled", false);
-        } else {
-            $('#show-query-button').attr("disabled", true);
-        }
+        // FIXME
+        //if (!$('#asbox').is(":checked")) {
+		//    $('#show-query-button').attr("disabled", false);
+        //} else {
+        //    $('#show-query-button').attr("disabled", true);
+        //}
     });
     
 });
@@ -436,9 +432,7 @@
 * @param    {Object}    res, a result object from a cherry geospatial query
 * @param    {Object}    extra, extra data passed from the API call - legacy stuff
 */
-function cherryQuerySyncCallback(res, extra) {
-    
-    //alert(JSON.stringify(res));
+function cherryQuerySyncCallback(res) {
     
     records = res["results"];
     if (typeof res["results"][0] == "object") {
@@ -454,7 +448,7 @@
         coordinates.push(coordinate);
     }
     
-    triggerUIUpdate(coordinates, extra["payload"], weights);
+    triggerUIUpdate(coordinates, param_placeholder["payload"], weights);
 }
 
 /**
diff --git a/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js b/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js
index dedc76e..bb7bc5f 100644
--- a/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js
+++ b/asterix-app/src/main/resources/sdk/static/js/asterix-sdk-stable.js
@@ -28,7 +28,7 @@
         statements = [ statements ];
     }
     
-    var query = "use dataverse " + this._properties["dataverse"] + "\n;" + statements.join("\n");
+    var query = "use dataverse " + this._properties["dataverse"] + ";\n" + statements.join("\n");
     var mode = this._properties["mode"];
     
     $.ajax({
@@ -307,10 +307,10 @@
 function ForClause(for_variable, at_variable, expression) {
     AQLClause.call(this);
   
-    this._properties["clause"] = "for $" + arguments[0];
+    this._properties["clause"] = "for " + arguments[0];
     
     if (arguments.length == 3) {
-        this._properties["clause"] += " at $" + arguments[1];
+        this._properties["clause"] += " at " + arguments[1];
         this._properties["clause"] += " in " + arguments[2].val();
     } else if (arguments.length == 2) {
         this._properties["clause"] += " in " + arguments[1].val();
@@ -335,7 +335,7 @@
 function LetClause(let_variable, expression) {
     AQLClause.call(this);
     
-    this._properties["clause"] = "let $" + let_variable + " := ";
+    this._properties["clause"] = "let " + let_variable + " := ";
     this._properties["clause"] += expression.val();
     
     return this; 
