Updating to use immutable array