refactored code, using pymongo solely now. further tests will follow up.