graph working

graph working, there may be something wrong with the connected
components part though.