removed the i = textnw... as remarked by Martin Hurton