Change x[1:] to x[1:end] to silence deprecation warnings