adding Templating.currentInputCount and input selection tracking, adding indexed data updating