remove some warnings and add some comments