Update matrix.swift