code: function getIndexForLoc(loc) {
    var col = Math.floor(loc.x / total_width);
    var row = Math.floor(loc.y / total_width);
    var index = col + (row * 5);
    return index;
  }
docs: Given a location, return the index of the element that is present at that location. If it doesn't correspond to a good index, then it is -1.