replace structs with vecs for ~27% speedup
second optimization to reduce number of divides, 14% improvement on top