remove useless comments
Port some code to C