after a bit of benchmarking, just casting the arrays is faster