completed most of the code to query the fp-tree