Refactored to bitwise MVM on matrix from repo