put matrix code in a separate file