Added genNEXT back