add cai calculation script