updated and added comments