checking in cooler version of bar.cpp