wrote tests to cover nested subdocuments