adapt source code