created a process for sort