implemented process method for sort