adapt source code
adapt source code