Finished writing the main stuff. Next working on the graphs