added class to the circle elements so we can distinguish them
code clean up
even more working. still problems after adding a new node