fixed bugs to get sample_calcomp working