diff --git a/asterix-examples/src/main/resources/black-cherry/cherry.tpl b/asterix-examples/src/main/resources/black-cherry/cherry.tpl
index 80ac5cf..778043e 100755
--- a/asterix-examples/src/main/resources/black-cherry/cherry.tpl
+++ b/asterix-examples/src/main/resources/black-cherry/cherry.tpl
@@ -137,10 +137,15 @@
                 <li class="list-group-item">
                   <button id="submit-button">Submit</button>
                   <button id="clear-button">Clear</button>
-                  <button id="show-query-button">Show Query</button><br/>
+                  <button id="show-query-button" style="display: none;">Show Query</button><br/>
                   <input type="checkbox" value="Submit Asynchronously" name="async" id="asbox" />
                   Submit asynchronously?
                 </li>
+                
+                <!-- Div to hold error messages -->
+                <li class="list-group-item">
+                    <div id="explore-report-message"></div>
+                </li>
               </ul>
             </div>
           
@@ -184,16 +189,13 @@
         
         <div class="col-md-7">
           <div class="container well" id="right-col">
-            <div id="map_canvas" style="width: 100%; height: 100%;"></div>
-            <div id="map_canvas_legend" style="display:none;"></div>
+            <div id="map_canvas" style="max-width: 100%; height: auto;"></div>
           </div>
         </div>
       </div>
       
       <!-- Modals and Dialogs -->
       <div class="row">
-        <!-- Show Query -> Error TODO Doesn't need to be this complicated... -->
-        <div id="dialog"><h4>You must submit a query first.</h4></div>
         
         <!-- On Drilldown, here is a nice modal -->
         <div class="modal fade" id="drilldown_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
@@ -206,15 +208,15 @@
               <div class="modal-body" id="drilldown_modal_body">
               
                 <!-- Tweet -->
-                <div id="modal-body-tweet" class="well well-sm">TWEET GOES HERE</div>
+                <div id="modal-body-tweet" class="well well-sm"></div>
               
                 <!-- Existing comments about this tweet -->
                 <!-- Create new comment -->
-                <div class="panel panel-default">
-                  <div class="panel-heading">In this Tweetbook</div>
+                <div class="panel panel-default" id="modal-existing-note">
+                  <div class="panel-heading">About this Tweetbook</div>
                   <div class="panel-body" id="modal-body-notes-holder">
                      
-                    <div class="input-group" id="modal-existing-note">
+                    <div class="input-group">
                       <input type="text" class="form-control" id="modal-body-tweet-note">
                       <span class="input-group-btn">
                         <button class="btn btn-default" id="modal-body-trash-icon">
@@ -228,7 +230,7 @@
                 </div> 
                 
                 <!-- Create new comment -->
-                <div class="panel panel-default">
+                <div class="panel panel-default" id="modal-save-tweet-panel">
                   <div class="panel-heading">Save to tweetbook</div>
                   <div class="panel-body" id="modal-save-body">
                     
@@ -244,6 +246,9 @@
                     
                     <!-- Comment on tweet to save -->
                     <button type="button" class="btn btn-default" id="save-comment-tweetbook-modal">Save</button>
+                    
+                    <div id="modal-body-message-holder"></div>
+                                        
                   </div>
                 </div> 
               </div>
diff --git a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
index 6a86075..7918648 100755
--- a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
+++ b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
@@ -10,8 +10,10 @@
     drilldown_data_map_vals = {};
     asyncQueryManager = {};
     
+    // Populate review mode tweetbooks    
     review_mode_tweetbooks = [];
     review_mode_handles = [];
+    getAllDataverseTweetbooks();
     
     map_cells = [];
     map_tweet_markers = [];
@@ -27,23 +29,13 @@
     $("#clear-button").button().click(function () {
         mapWidgetResetMap();
         
+        $('#explore-report-message').html('');
         $('#query-preview-window').html('');
         $("#metatweetzone").html('');
     });
     
     // UI Elements - Query setup
     $("#selection-button").button('toggle');
- 
-    var dialog = $("#dialog").dialog({
-        width: "auto",
-        title: "AQL Query"
-    }).dialog("close");
-    $("#show-query-button")
-    	.button()
-    	.attr("disabled", true)
-    	.click(function (event) {
-        	$("#dialog").dialog("open");
-    	});
     
     // UI Element - Grid sliders
     var updateSliderDisplay = function(event, ui) {
@@ -195,9 +187,10 @@
     	
         var kwterm = $("#keyword-textbox").val();
         if (kwterm == "") {
-            alert("Please enter a search term!");
+            addFailureBlock("Please enter a search term!", "explore-report-message");
         } else {
         
+            $("#explore-report-message").html('');
             $("#submit-button").attr("disabled", true);
     	
             var startdp = $("#start-date").datepicker("getDate");
@@ -247,7 +240,8 @@
 		        "data" : formData
 		    };
 		
-		    $('#dialog').html(APIqueryTracker["query"]);
+		    // TODO
+		    //$('#dialog').html(APIqueryTracker["query"]);
         
             if (build_cherry_mode == "synchronous") {
                 A.query(f.val(), cherryQuerySyncCallback, build_cherry_mode);
@@ -301,8 +295,50 @@
     return aql;
 }
 
-/** Asynchronous Query Management **/
 
+/**
+* 
+*/
+
+
+/**
+* getAllDataverseTweetbooks
+* 
+* no params
+*  
+* Returns all datasets of type TweetbookEntry, populates review_mode_tweetbooks
+*/
+function getAllDataverseTweetbooks(fn_tweetbooks) {
+    // Tweetbook Metadata Query
+    var getTweetbooks = new FLWOGRExpression()
+        .ForClause("$ds", new AExpression("dataset Metadata.Dataset"))
+        .WhereClause(new AExpression('$ds.DataTypeName = "TweetbookEntry"'))
+        .ReturnClause({
+            "tweetbookTitle" : "$ds.DatasetName",
+        });
+    
+    // Run query
+    A.query(getTweetbooks.val(), function(r) {
+        // Parse tweetbook metadata results
+        var tweetbookMetadata = r["results"];
+        
+        // Add existing tweetbooks
+        review_mode_tweetbooks = [];
+        $.each(tweetbookMetadata, function (i, v) {
+            review_mode_tweetbooks.push(tweetbookMetadata[i].split(": \"")[1].split("\"")[0]);
+        });
+        
+        // Populate review screen, if possible.
+        $('#review-tweetbook-titles').html('');
+        for (tb in review_mode_tweetbooks) {
+            addTweetBookDropdownItem(review_mode_tweetbooks[tb]);
+        }
+    });
+    
+}
+
+
+/** Asynchronous Query Management **/
 
 /**
 * Checks through each asynchronous query to see if they are ready yet
@@ -393,7 +429,8 @@
                 "query" : asyncQueryManager[handle_id]["query"],
                 "data"  : asyncQueryManager[handle_id]["data"]
             };
-            $('#dialog').html(APIqueryTracker["query"]);
+            // TODO
+            //$('#dialog').html(APIqueryTracker["query"]);
         
             if (!asyncQueryManager[handle_id].hasOwnProperty("result")) {
                 // Generate new Asterix Core API Query
@@ -419,6 +456,9 @@
             delete asyncQueryManager[handle_id];
         }
     );
+    
+    $('#async_container_' + handle_id).append('<br/>');
+    
     $("#submit-button").attr("disabled", false);
 }
 
@@ -528,16 +568,10 @@
                 }
             });
             
-            google.maps.event.addListener(map_circle, 'mouseout', function(event) {
-                map_info_windows[m].close();
-            });
-            
             // Add this marker to global marker cells
             map_cells.push(map_circle);
         }    
     });
-    
-    // Remove widget for now mapControlWidgetAddLegend(dataBreakpoints);
 }
 
 /**
@@ -613,51 +647,6 @@
 }
 
 
-function addTweetbookCommentDropdown(appendToDiv) {
-
-    // Creates a div to manage a radio button set of chosen tweetbooks
-    $('<div/>')
-        .attr("class","btn-group chosen-tweetbooks")
-        .attr("data-toggle", "buttons-radio")
-        .css("margin-bottom", "10px")
-        .attr("id", "metacomment-tweetbooks")
-        .appendTo(appendToDiv); 
-    
-    var highlighted = "";
-    if (APIqueryTracker.hasOwnProperty("active_tweetbook")) {
-        highlighted = APIqueryTracker["active_tweetbook"];
-    }
-    
-    // For each existing tweetbook from review mode, adds a radio button option. 
-    $('#metacomment-tweetbooks').append('<input type="hidden" id="target-tweetbook" value="" />');
-    for (var rmt in review_mode_tweetbooks) {
-    
-        var tweetbook_option = '<button type="button" class="btn">' + review_mode_tweetbooks[rmt] + '</button>';
-                
-        if (review_mode_tweetbooks[rmt] == highlighted) {
-            tweetbook_option = '<button type="button" class="btn btn-info">' + review_mode_tweetbooks[rmt] + '</button>';   
-        }  
-                
-        $('#metacomment-tweetbooks').append(tweetbook_option + '<br/>');
-    }
-    
-    // Creates a button + input combination to add tweet comment to new tweetbook
-    var new_tweetbook_option = '<button type="button" class="btn" id="new-tweetbook-target-m"></button>' + 
-        '<input type="text" id="new-tweetbook-entry-m" placeholder="Add to new tweetbook..."><br/>';
-    $('#metacomment-tweetbooks').append(new_tweetbook_option);
-    
-    $("#new-tweetbook-entry-m").keyup(function() {
-        $("#new-tweetbook-target-m").val($("#new-tweetbook-entry-m").val());
-        $("#new-tweetbook-target-m").text($("#new-tweetbook-entry-m").val());
-    });
-    
-    // There is a hidden input (id = target-tweetbook) which is used to track the value
-    // of the tweetbook to which the comment on this tweet will be added.
-    $(".chosen-tweetbooks .btn").click(function() {
-        $("#target-tweetbook").val($(this).text()); 
-    });
-}
-
 function onDrillDownAtLocation(tO) {
 
     var tweetId = tO["tweetEntryId"];
@@ -666,16 +655,19 @@
     // First, set tweet in drilldown modal to be this tweet's text
     $('#modal-body-tweet').html('Tweet #' + tweetId + ": " + tweetText);
     
-    // Next, empty any leftover tweetbook comments
+    // Next, empty any leftover tweetbook comments or error/success messages
     $("#modal-body-add-to").val('');
     $("#modal-body-add-note").val('');
+    $("#modal-body-message-holder").html("");
     
     // Next, if there is an existing tweetcomment reported, show it.
     if (tO.hasOwnProperty("tweetComment")) {
         
+        // Show correct panel
         $("#modal-existing-note").show();
+        $("#modal-save-tweet-panel").hide();
         
-        // Change comment value
+        // Fill in existing tweet comment
         $("#modal-body-tweet-note").val(tO["tweetComment"]);
         
         // Change Tweetbook Badge
@@ -702,56 +694,48 @@
         });
         
     } else {
+        // Show correct panel
         $("#modal-existing-note").hide();
-    }
-     
-    // Now, when adding a comment to a tweetbook...
-    $("#save-comment-tweetbook-modal").on('click', function(e) {
-        // Stuff to save about new comment
-        var save_metacomment_target_tweetbook = $("#modal-body-add-to").val();
-        var save_metacomment_target_comment = '"' + $("#modal-body-add-note").val() + '"';
-        var save_metacomment_target_tweet = '"' + tweetId + '"';
+        $("#modal-save-tweet-panel").show();
         
-        // Make sure content is entered, and then save this comment.
-        if (save_metacomment_target_tweetbook.length == 0) {
-            alert("Please enter a tweetbook.");
-        } else if ($("#modal-body-add-note").val() == "") {
-            alert("Please enter a comment.");
-        } else {
+        // Now, when adding a comment on an available tweet to a tweetbook
+        $("#save-comment-tweetbook-modal").on('click', function(e) {
         
-            // Check if tweetbook exists. If not, create it.
-            if (!(existsTweetbook(save_metacomment_target_tweetbook))) {
-                onCreateNewTweetBook(save_metacomment_target_tweetbook);
+            // Stuff to save about new comment
+            var save_metacomment_target_tweetbook = $("#modal-body-add-to").val();
+            var save_metacomment_target_comment = '"' + $("#modal-body-add-note").val() + '"';
+            var save_metacomment_target_tweet = '"' + tweetId + '"';
+        
+            // Make sure content is entered, and then save this comment.
+            if (save_metacomment_target_tweetbook.length == 0) {
+                alert("Please enter a tweetbook.");
+            } else if ($("#modal-body-add-note").val() == "") {
+                alert("Please enter a comment.");
             } else {
-            
-                var toDelete = new DeleteStatement(
-                    "$mt",
-                    save_metacomment_target_tweetbook,
-                    new AExpression("$mt.tweetid = " + save_metacomment_target_tweet.toString())
-                );
-                A.update(toDelete.val());
-            }
-            
-            var toInsert = new InsertStatement(
-                save_metacomment_target_tweetbook,
-                { 
-                    "tweetid" : save_metacomment_target_tweet.toString(), 
-                    "comment-text" : save_metacomment_target_comment 
+        
+                // Check if tweetbook exists. If not, create it.
+                if (!(existsTweetbook(save_metacomment_target_tweetbook))) {
+                    onCreateNewTweetBook(save_metacomment_target_tweetbook);
                 }
-            );
-            A.update(toInsert.val(), function () {});
             
-            // TODO Some stress testing of error conditions might be good here...
-            if (APIqueryTracker.hasOwnProperty("active_tweetbook")) {
-                onPlotTweetbook(APIqueryTracker["active_tweetbook"]);
-            };
-            var successMessage = "Saved comment on <b>Tweet #" + tweetId + 
-                "</b> in dataset <b>" + save_metacomment_target_tweetbook + "</b>.";
-            addSuccessBlock(successMessage, "modal-save-body");
-            $("#modal-body-add-to").val('');
-            $("#modal-body-add-note").val('');
-        }   
-    });
+                var toInsert = new InsertStatement(
+                    save_metacomment_target_tweetbook,
+                    { 
+                        "tweetid" : save_metacomment_target_tweet.toString(), 
+                        "comment-text" : save_metacomment_target_comment 
+                    }
+                );
+                A.update(toInsert.val(), function () {});
+            
+                var successMessage = "Saved comment on <b>Tweet #" + tweetId + 
+                    "</b> in dataset <b>" + save_metacomment_target_tweetbook + "</b>.";
+                    addSuccessBlock(successMessage, "modal-body-message-holder");
+            
+                $("#modal-body-add-to").val('');
+                $("#modal-body-add-note").val('');
+            }   
+        });
+    }
 }
 
 
@@ -810,7 +794,6 @@
         onPlotTweetbook(tweetbook);
     });
     
-    // TODO Button Same Length
     // Add trash button for this tweetbook
     var onTrashTweetbookButton = addDeleteButton(
         "rm_trashbook_" + tweetbook,
@@ -1047,12 +1030,11 @@
 * @param    {Function}  onClick, a function to fire when this icon is clicked
 */
 function addDeleteButton(iconId, attachTo, onClick) {
-    // Icon structure
-    var trashIcon = '<button class="btn btn-default" id="' + iconId + '"><span class="glyphicon glyphicon-trash"></span></button>';
     
+    var trashIcon = '<button class="btn btn-default" id="' + iconId + '"><span class="glyphicon glyphicon-trash"></span></button>';
     $('#' + attachTo).append(trashIcon);
     
-    // On Click behavior
+    // When this trash button is clicked, the function is called.
     $('#' + iconId).on('click', onClick);
 }
 
@@ -1063,64 +1045,33 @@
 * @param    {String}    appendTarget, a target div to which to append the alert
 */
 function addSuccessBlock(message, appendTarget) {
-
+    $('#' + appendTarget).html('');
     $('<div/>')
         .attr("class", "alert alert-success")
         .html('<button type="button" class="close" data-dismiss="alert">&times;</button>' + message)
         .appendTo('#' + appendTarget);
 }
 
-/** Map Widget Utility Methods **/
-
 /**
-* Plots a legend onto the map, with values in progress bars
-* @param    {number Array}  breakpoints, an array of numbers representing natural breakpoints
+* Creates a failure mesage and attaches it to a div with provided id.
+* @param    {String}    message, a message to post
+* @param    {String}    target, a target div to append the message
 */
-function mapControlWidgetAddLegend(breakpoints) {
-   
-    // Retriever colors, lightest to darkest
-    var colors = mapWidgetGetColorPalette();
-    
-    // Initial div structure
-    $("#map_canvas_legend").html('<div id="legend-holder"><div id="legend-progress-bar" class="progress"></div><span id="legend-label"></span></div>');
-
-    // Add color scale to legend
-    $('#legend-progress-bar').css("width", "200px").html('');
-    
-    // Add a progress bar for each color
-    for (var color in colors) {
-        
-        // Bar values
-        var upperBound = breakpoints[parseInt(color) + 1];
-        
-        // Create Progress Bar
-        $('<div/>')
-            .attr("class", "bar")
-            .attr("id", "pbar" + color)
-            .css("width" , '25.0%')
-            .html("< " + upperBound)
-            .appendTo('#legend-progress-bar');
-        
-        $('#pbar' + color).css({
-            "background-image" : 'none',
-            "background-color" : colors[parseInt(color)]
-        });
-        
-        // Attach a message showing minimum bounds     
-        $('#legend-label').html('Regions with at least ' + breakpoints[0] + ' tweets');
-        $('#legend-label').css({
-            "margin-top" : 0,
-            "color" : "black"
-        });
-    }
-    
-    // Add legend to map
-    map.controls[google.maps.ControlPosition.LEFT_BOTTOM].push(document.getElementById('legend-holder'));
-    $('#map_canvas_legend').show(); 
+function addFailureBlock(message, target) {
+    $('#' + target).html('');
+    $('<div/>')
+        .attr("class", "alert alert-danger")
+        .html('<button type="button" class="close" data-dismiss="alert">&times;</button>' + message)
+        .appendTo('#' + target);
 }
 
+
 /**
-* Clears ALL map elements - legend, plotted items, overlays
+* mapWidgetResetMap
+*
+* [No Parameters]
+*
+* Clears ALL map elements - plotted items, overlays, then resets position
 */
 function mapWidgetResetMap() {
 
@@ -1136,6 +1087,13 @@
     map.setZoom(4);
 }
 
+/**
+* mapWidgetClearMap
+*
+* No parameters
+*
+* Removes data/markers
+*/
 function mapWidgetClearMap() {
 
     // Remove previously plotted data/markers
@@ -1148,9 +1106,6 @@
         map_tweet_markers[m].setMap(null);
     }
     map_tweet_markers = [];
-
-    // Remove legend from map
-    map.controls[google.maps.ControlPosition.LEFT_BOTTOM].clear();
 }
 
 /**
