Added expandMiddle to actually implement the insertMiddle method.