Converted global array access to use idx function.