Change 'elements' to 'nodes', update loops and stuff