Moved matrix to window.add