is there a way to do this without using a for loop? this must be slow for large ArrayBuffers, i would imagine