added proper node indexing