some bugs
the first function integration