Add number of degree of freedom for nodes (thanks @Flolagale)