build matricies hack