print STDERR "Creating database\n";
 
-               #print STDERR Dumper(\%INC);
-               #delete $INC{'Insipid/Database.pm'};
-
                # This means that a database connection was established but the
                # tables were not found.
                undef($@);
 
 
         # Join the tag tables only when necessary
 
-        if (url_param('tag') =~ / /) {
+               if(url_param('tag') eq "empty") {
+                       
+                       # allow this action only for logged in users
+                       check_access();
+                       
+                       $sql = $sql." left join $tbl_bookmark_tags on 
+                         ($tbl_bookmarks.id = 
+                               $tbl_bookmark_tags.bookmark_id)
+                               WHERE $tbl_bookmark_tags.bookmark_id IS NULL";
+               }
+        elsif (url_param('tag') =~ / /) {
             my @tags = split(/ /, url_param('tag'));
             my $icount = 1;
 
 
        print '</select>';
        print '<input type=hidden name="op" value="tags">';
        print '<input type=hidden name="doDelete" value="yes">';
-               print '<input type="submit" value="Delete and move" />';
+       print '<input type="submit" value="Delete and move" />';
        print '</form>';
+       
+       print '<h2>Show bookmarks without a tag</h2>';
+       print '<p><a href="'.$site_url.'/insipid.cgi?tag=empty">Show me the bookmarks</a></p>';
 }
 
 # Display the tag list.  Takes one parameter for the mode - 0 is for the