Document Node implementation, update calculateFrequencies method to use Node