Bi HSE, sort algoritms in javascript