if you want to optimize that even more then use ++i instead of i++