new code Bar.cpp