Great program, but I think I found a bug. These steps will reproduce it: src = [1,2,3] des = [3,1,4,2] Create a patch from these then apply the patch to src. It will produce an index out of bounds exception.