Added tree random initialization; node count function