Working version of cv_ghost