shaping the gen algor