Added graphs, automated to work with matlab