Added graph functionality, branched to work out kinks and clean up code