Returns an array of different values draw from a subarray input
Added array boundary checking for output array
appears to be working