public static void MoveInstructionsToEnd(this IList<Instruction> instructions, int startIndex, int length)
{
var instructionsToMove = new List<Instruction>();
for (int i = startIndex; i < startIndex + length; i++)
{
instructionsToMove.Add(instructions[startIndex]);
instructions.RemoveAt(startIndex);
}
Insert(instructions, instructions.Count - 1, instructionsToMove);
}