                 index = index.successor()
             }
             
+            
             if(removeflag){
-                earlyshiftlocationarray = self.AAA(earlyshiftlocationarray, pivotindex: index, text: staffarraytmp)
-                center1shiftlocationarray = self.AAA(center1shiftlocationarray, pivotindex: index, text: staffarraytmp)
-                center2shiftlocationarray = self.AAA(center2shiftlocationarray, pivotindex: index, text: staffarraytmp)
-                center3shiftlocationarray = self.AAA(center3shiftlocationarray, pivotindex: index, text: staffarraytmp)
-                lateshiftlocationarray = self.AAA(lateshiftlocationarray, pivotindex: index, text: staffarraytmp)
-                othershiftlocationarray = self.AAA(othershiftlocationarray, pivotindex: index, text: staffarraytmp)
-                holidayshiftlocationarray = self.AAA(holidayshiftlocationarray, pivotindex: index, text: staffarraytmp)
-            }
-            
-            
+                earlyshiftlocationarray = self.RemoveElementThanPivotIndex(earlyshiftlocationarray, pivotindex: index, text: staffarraytmp)
+                center1shiftlocationarray = self.RemoveElementThanPivotIndex(center1shiftlocationarray, pivotindex: index, text: staffarraytmp)
+                center2shiftlocationarray = self.RemoveElementThanPivotIndex(center2shiftlocationarray, pivotindex: index, text: staffarraytmp)
+                center3shiftlocationarray = self.RemoveElementThanPivotIndex(center3shiftlocationarray, pivotindex: index, text: staffarraytmp)
+                lateshiftlocationarray = self.RemoveElementThanPivotIndex(lateshiftlocationarray, pivotindex: index, text: staffarraytmp)
+                othershiftlocationarray = self.RemoveElementThanPivotIndex(othershiftlocationarray, pivotindex: index, text: staffarraytmp)
+                holidayshiftlocationarray = self.RemoveElementThanPivotIndex(holidayshiftlocationarray, pivotindex: index, text: staffarraytmp)
+            }
             
             
             //要素数を比較して正しくシフト体制を認識できているかチェックする

        }
        
        //スタッフの人数分(配列の最後まで)繰り返す
//        for(var i = 2; i < 3; i++){

        for(var i = 1; i < staffarray.count; i++){
        

                appDelegate.errorshiftname[staffname] = messagetext
            }
        }

        let file_name = "TEST.txt"
        let text = dayshiftarray[0]
        
