add lib and format code