Subjects undergoing elective ERCP and EUS will receive standard monitoring and sedation. In addition, capnography which measures carbon dioxide levels and can graphically assess respiratory activity will be used. Subjects will be randomized to either a capnography blinded or titration arm. In the capnography titration arm, the endoscopy team would be made aware of capnographic abnormalities as they arise throughout the procedure. In the capnography blinded arm, this information will not be available to the endoscopy team and represents standard of care. It is our hypothesis that using capnography can prevent low oxygen levels known as hypoxemia, during these procedures.