constructor takes frequency table instead of tree, which makes way more sense...