add missing files
more codes
fix some bugs