added comments for malloc