added comments and mem leak checked