vectorize. also ^2 is bitwise xor dammit