now functional as before - kind of -, but with direct pymongo layer
moved all element variables to vars dictionary.