processGeneration function written untested!