Updated document with changes made in the code