private int getIndexToWrite() { //returns the first empty particle array index, and if none exist returns the location of the "oldest" particle instead
        int oldestParticleAge = 0;
        int oldestParticleIndex = 0;
        
        for (int particleIndex = 0; particleIndex < particleArray.length; particleIndex++) {
            if (particleArray[particleIndex] == null) {
                return particleIndex;
            } else if (particleArray[particleIndex].getAge() > oldestParticleAge) {
                oldestParticleAge = particleArray[particleIndex].getAge();
                oldestParticleIndex = particleIndex;
            }
        }
        
        return oldestParticleIndex;
    }