updating with latest changes from Chris and Paddy