Added globals for ease of use and updated code to reflect new changes in arrays.py