Replaced subarrays as its own separate function, since it is sometimes called on arrays other than self.data. For Ticket #129.