any reason your are not initializing 'i' ?