Updated with Mark's changes