tbd : split c routine