you have to use integer(i) as index.