implemented Arnaud's changes