refactoring
added avx version