made changes to array being passed into functions