make matrix global