adding lastest code from hg repository