add in cpp versions of imputation for speedup