move code from Caption.h to Caption.cpp
decrypt the logic