some vector and matrix optimizations