Batarray

two functions for BatArray, regarding sorted arrays.