appccm algorithm implementation