Change "x[i:]" to "x[i:end]"