almost ok for cdev function