fix deprecated x[i:] syntax