Added most of Carole's changes