Added Brooke's code