generalization to GP and GA