start of sorting