small error for counting nodes fixed