fixing calcF to use index of tag arrays at all instances