Restructured Generator to allow for different algorithms