add script testing the build_matrix function