the complete version to submit based on Guillaume and Martin revision - consolidated by Jinbang (2014/03/09)