w2v-server: show window/column normalized collocators
diff --git a/templates/index.html.ep b/templates/index.html.ep
index 427fb56..78ec921 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -48,18 +48,33 @@
 						 ]
 				 } );
 
-         $('#secondtable').DataTable({
+         var t = $('#secondtable').DataTable({
 						 "sScrollY": "800px",
 						 "bScrollCollapse": true,
 						 "bPaginate": false,
 						 "bJQueryUI": true,
 						 "dom": '<"top">rt<"bottom"flp><"clear">',
-						 "aoColumnDefs": [
-								 { "sWidth": "10%", "aTargets": [ -1 ] }
-						 ]
+						 "columnDefs": [
+								 { "searchable": false,
+									 "orderable": false,
+									 "targets": 0
+								 }, 
+								 { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4 ] },
+								 { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 5 ] },
+								 { "orderSequence": [ "desc" ], "targets": [ 3 ] }
+						 ],
+						 "order": [[ 3, 'desc' ]],
 				 } );
+				 t.on( 'order.dt search.dt', function () {
+						 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
+								 cell.innerHTML = i+1;
+						 } );
+				 } ).draw();
+
 		 });
 
+
+
 		 $(function(){
 				 $("#dropdownoptions").dialog({
 						 title: "Options",
@@ -720,15 +735,15 @@
 									% if($collocators) {
 										<th>#</th>
 										<th align="right" title="The window around the target word that is considered for summation.">w'</th>
-										<th align="right" title="Raw (max.) activation of the collocator in the output layers.">a</th>
-										<th title="Σp(c<sub><small>@</small></sub>) – Sum of the probability approximations that the combination of the target word and the collocator at the relative position @ come from the training corpus. Single approximations can be distorted because of sub-sampling frequent words and the sum cannot itself be interpreted as probability." align="right">Σp</th>
-										<th align="right">Σp/|w|</th>
+										<th align="right" title="Raw (max.) activation of the collocator in the output layers.">max(a)</th>
+										<th title="(c<sub><small>@</small></sub>) – Sum of the probability approximations that the combination of the target word and the collocator at the relative position @ come from the training corpus. Single approximations can be distorted because of sub-sampling frequent words and the sum cannot itself be interpreted as probability." align="right">⊥Σa</th>
+										<th align="right">Σa/Σw</th>
 										<th title="c" align="left">collocator</th>
 									% }
 								</tr>
 							</thead>
 							<tbody>
-								% for(my $i=0; $i < 100; $i++) {
+								% for(my $i=0; $i < (@$collocators); $i++) {
 									% my $c = ($collocators? (@$collocators)[$i] : 0);
 									<tr>
 										<td align="right">
@@ -739,13 +754,13 @@
 												<span class="mono"><%= bitvec2window( $c->{pos} ) %></span>
 											</td>
 											<td align="right">
-												<%= sprintf("%.3f", $c->{dist}) %>
+												<%= sprintf("%.3f", $c->{max}) %>
 											</td>
 											<td align="right">
-												<%= sprintf("%.3e", $c->{norm}) %>
+												<%= sprintf("%.3e", $c->{conorm}) %>
 											</td>
 											<td align="right">
-												<%= sprintf("%.3e", $c->{sum}) %>
+												<%= sprintf("%.3e", $c->{prob}) %>
 											</td>
 											<td align="left">
 												<a onclick="<%= sprintf("queryKorAPCII('%s /w5 %s')", $c->{word}, $word) =%>"