diff --git a/templates/index.html.ep b/templates/index.html.ep
index cb833ea..d818149 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -233,12 +233,12 @@
              //                      { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
              { "data": "llr",  render: function ( data, type, row ) {return data.toFixed(0) }},
              { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
-//             { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) }  },
+             //             { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) }  },
              { "data": "npmi", render: function ( data, type, row ) {return data.toFixed(2) }},
-             { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
-             { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
-             { "data": "lnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
-             { "data": "rnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
+             { "data": "llfmd", class: "detail", render: function ( data, type, row ) {return data.toFixed(1) }},
+             { "data": "rlfmd", class: "detail", render: function ( data, type, row ) {return data.toFixed(1) }},
+             { "data": "lnpmi", class: "detail", render: function ( data, type, row ) {return data.toFixed(2) }},
+             { "data": "rnpmi", class: "detail", render: function ( data, type, row ) {return data.toFixed(2) }},
              { "data": "f" },
              { "data": "word",  sClass: "collocator" }
            ],
@@ -257,135 +257,145 @@
            "order": [[ 1, 'desc' ]],
          });
 
-         $("td.collocator").click(function(){
-           queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
+
+         $('#show-details').change(function (e) {
+           var columns = classicCollocatorTable.columns(".detail");
+           if(this.checked) {
+             columns.visible(true);
+           } else {
+             columns.visible(false);
+           }
+         } );
+
+           $("td.collocator").click(function(){
+             queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
+           });
+
+           collocatorTable.on( 'order.dt search.dt', function () {
+             collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
+               cell.innerHTML = i+1;
+             } );
+           }).draw();
+         }
+
+         if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
+           var index = parseInt(localStorage['tab']||'0');
+           $("#tabs").tabs({ active: index });
+         }
+         $("#tabs").css("visibility", "visible"); // now we can show the tabs
+       });
+
+       $(function(){
+         $("#dropdownoptions").dialog({
+           title: "Options",
+           autoOpen: false,
+           modal: false,
+           draggable: false,
+           height: "auto",
+           width: "auto",
+           resizable: false,
+           buttons: {
+             "Cancel": function() {
+               $( this ).dialog( "close" );
+             },
+             "Apply": function() {
+               window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
+             }
+           }
          });
+       });
 
-         collocatorTable.on( 'order.dt search.dt', function () {
-           collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
-             cell.innerHTML = i+1;
-           } );
-         }).draw();
-       }
+       $(function(){
+         $("#showoptions").click(function(){
+           $("#dropdownoptions").dialog("open");
+           var target = $(this);
+           $("#dropdownoptions").dialog("widget").position({
+             my: 'left bottom',
+             at: 'left bottom',
+             of: target
+           });
+         });
+       });
 
-       if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
-         var index = parseInt(localStorage['tab']||'0');
-         $("#tabs").tabs({ active: index });
-       }
-       $("#tabs").css("visibility", "visible"); // now we can show the tabs
-     });
+       $( function() {
+         $( "#no_iterations" ).spinner({
+           spin: function( event, ui ) {
+             if ( ui.value < 1000 ) {
+               $( this ).spinner( "value", 1000 );
+               return false;
+             } else if ( ui.value > 10000 ) {
+               $( this ).spinner( "value", 10000 );
+               return false;
+             }
+           }
+         });
+       } );
 
-     $(function(){
-       $("#dropdownoptions").dialog({
-         title: "Options",
-         autoOpen: false,
-         modal: false,
-         draggable: false,
-         height: "auto",
-         width: "auto",
-         resizable: false,
-         buttons: {
-           "Cancel": function() {
-             $( this ).dialog( "close" );
+       $( function() {
+         $( "#neighbours" ).spinner({
+           spin: function( event, ui ) {
+             if ( ui.value < 0 ) {
+               $( this ).spinner( "value", 0 );
+               return false;
+             } else if ( ui.value > 200 ) {
+               $( this ).spinner( "value", 200 );
+               return false;
+             }
+           }
+         });
+       } );
+
+       $( function() {
+         $( "#cutoff" ).spinner({
+           spin: function( event, ui ) {
+             if ( ui.value < 100000 ) {
+               $( this ).spinner( "value", 100000 );
+               return false;
+             } else if ( ui.value > 2000000 ) {
+               $( this ).spinner( "value", 2000000 );
+               return false;
+             }
+           }
+         });
+       } );
+
+       $( function() {
+         $( "#tabs" ).tabs().addClass('tabs-min');
+       } );
+
+       $( function() {
+         $( ".controlgroup-vertical" ).controlgroup({
+           "direction": "vertical"
+         });
+       } );
+
+       $(function() {
+         $( document ).tooltip({
+           content: function() {
+             return $(this).attr('title');
+           }}
+         )
+       });
+
+       $(function () {
+         $(document).tooltip({
+           content: function () {
+             return $(this).prop('title');
            },
-           "Apply": function() {
-             window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
+           show: null, 
+           close: function (event, ui) {
+             ui.tooltip.hover(
+               function () {
+                 $(this).stop(true).fadeTo(400, 1);
+               },    
+               function () {
+                 $(this).fadeOut("400", function () {
+                   $(this).remove();
+                 })
+               });
            }
-         }
-       });
-     });
-
-     $(function(){
-       $("#showoptions").click(function(){
-         $("#dropdownoptions").dialog("open");
-         var target = $(this);
-         $("#dropdownoptions").dialog("widget").position({
-           my: 'left bottom',
-           at: 'left bottom',
-           of: target
          });
        });
-     });
-
-     $( function() {
-       $( "#no_iterations" ).spinner({
-         spin: function( event, ui ) {
-           if ( ui.value < 1000 ) {
-             $( this ).spinner( "value", 1000 );
-             return false;
-           } else if ( ui.value > 10000 ) {
-             $( this ).spinner( "value", 10000 );
-             return false;
-           }
-         }
-       });
-     } );
-
-     $( function() {
-       $( "#neighbours" ).spinner({
-         spin: function( event, ui ) {
-           if ( ui.value < 0 ) {
-             $( this ).spinner( "value", 0 );
-             return false;
-           } else if ( ui.value > 200 ) {
-             $( this ).spinner( "value", 200 );
-             return false;
-           }
-         }
-       });
-     } );
-
-     $( function() {
-       $( "#cutoff" ).spinner({
-         spin: function( event, ui ) {
-           if ( ui.value < 100000 ) {
-             $( this ).spinner( "value", 100000 );
-             return false;
-           } else if ( ui.value > 2000000 ) {
-             $( this ).spinner( "value", 2000000 );
-             return false;
-           }
-         }
-       });
-     } );
-
-     $( function() {
-       $( "#tabs" ).tabs().addClass('tabs-min');
-     } );
-
-     $( function() {
-       $( ".controlgroup-vertical" ).controlgroup({
-         "direction": "vertical"
-       });
-     } );
-
-     $(function() {
-       $( document ).tooltip({
-         content: function() {
-           return $(this).attr('title');
-         }}
-       )
-     });
-
-     $(function () {
-       $(document).tooltip({
-         content: function () {
-           return $(this).prop('title');
-         },
-         show: null, 
-         close: function (event, ui) {
-           ui.tooltip.hover(
-             function () {
-               $(this).stop(true).fadeTo(400, 1);
-             },    
-             function () {
-               $(this).fadeOut("400", function () {
-                 $(this).remove();
-               })
-             });
-         }
-       });
-     });
     </script>
     <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
     <script src="/derekovecs/js/tsne.js"></script>
@@ -642,8 +652,8 @@
             T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
             T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
             return "translate(" +
-                                                      (d.x) + "," +
-                                                      (d.y) + ")";
+                                                        (d.x) + "," +
+                                                        (d.y) + ")";
           });
      }
 
@@ -653,8 +663,8 @@
           .data(data.words)
           .attr("transform", function(d, i) {
             return "translate(" +
-                                                       ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
-                                                       ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
+                                                         ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
+                                                         ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
      }
 
      var svg;
@@ -891,6 +901,10 @@
                 </select>
               % }
               <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
+              <input id="show-details" type="checkbox" name="show-details" value="1" >
+              <label for="show-details">
+                Show details
+              </label>
             </div>
           </form>
         </div>
@@ -1018,7 +1032,7 @@
                     <th title="raw max frequency of collocation within window">raw</th>
                     <th>collocator</th>
                   </tr>
-                  % }
+                % }
               </thead>
               <tbody>
                 <tr>
