I have updated and added comments