Adds function to calculate number of nodes for a given depth of tree.
Adds possibility to write statistics to file.