fix and added comments