merged changes from Keir

merged changes from Keir