Adding Mary's code