Merged Peter's latest changes