bridge.cpp implement