function piece_clicked(el) {
  if (g_piece=='') {
    g_piece=el;
    g_piece.classList.add('highlight');
  } else if (g_piece==el) {
    g_piece.classList.remove('highlight');
    g_piece='';
  } else {
    // swap
    var r=el.style.gridRowStart;
    var c=el.style.gridColumnStart;
    el.style.gridRowStart= g_piece.style.gridRowStart;
    el.style.gridColumnStart= g_piece.style.gridColumnStart;
    g_piece.style.gridRowStart=r;
    g_piece.style.gridColumnStart=c;
    g_piece.classList.remove('highlight');
    g_piece='';
   if (finished()) finale();
  }
}