simplify node counting