new matrix math for transitions