How do I build matrix?