Update with Chris' new code