changed i to frameCount