added previewgen.cpp .h