Updated to latest codes