updating from Wiggins's branch