changed add_greater_number method from recursive to iterative