Added array splicing to pseudocode