merged emmanuel's changes to the codes