reorganizing cdefs, added task control functions