modified building.cpp