added CO-smart-CAST algo but incorrect

added CO-smart-CAST algo but incorrect