i've heard that incrementing at the correct spot when dealing with arrays really helps stop segfaults.