exclamationMark is defined as 
var exclamationIndex = depName.indexOf("!");

However depName, is different to deps[i], This code basically removes the " text! " from the file name, 
However if you use original index you get left with something like "xt!/sbt/connections.."
Because the deps[i] is different that depName, so the index of '!' if different for both files