cleanup and optimizations
first attempt at fixing aliasing and alignment in vectorization