Added sortbyte subroutine