generalized EA task code considerably