finished adding mongo code