added scd function