added opt.h and opt.cpp