added old mongo code