CA sample compiles, almost working 100%