Added graphs and refactor libraries