fix the bug, split the h and cpp
fix the bug and split cpp and h