changes:
* improve #include
* free memory (has bug, to be continue)