main file updated to run and output matrix