Changed unique variables into Local ArrayCount to conserve memory without causing errors