Updated the generator to work with the min and max register