Update the code and correction of errors