I have updated the code as required.