Added some getNumberOfNodes

Added getNumberOfNodes and moved some stuff around so that it looks
better