code for working with Ryan's simulations and my CGM project with David