first iteration of CAI; to be redesigned