Added some matrix math.