Update ad.cpp