Updated with Bryn's changes