Updated matrix stuff