merge the code from futing