fixes based on discussions with rory