refactor so that probability calculations are within the context of documents given