update the main codes