added some comment;removed unused code;