added matrix plots and updated variables