Added Nelly's work from master.