sort worker's functions