Added conditional processing code for get-next-gen.