Added a lot of follow up code for the modal presentation