Fixing errors in cds, still missing some functions