Ahhhh ok now I got it! Same class name could return multiple nodes... I will try again now that I know these things
I'm also thinking if it would be appropriate to modify system files directly or not, to make persistent changes (embedding the javascript in the head at least). For now it seems to me too risky