added mongodb stuff, more variables, some clean up