Question: I'm trying the list all factors of a number using the following method:

```
def find_factors(n)
  factors = []
  2.upto(n-1) {|x| factors << x if n % x == 0}
end

factor = find_factors(24)
puts factor

```

Its printing out the following:

```
2

```

instead of the list of factors! What am if doing incorrectly?

Answer: 
`upto` used with a block returns the receiver, which is `2`.

A better way to write this would be:

```
def find_factors(n)
  2.upto(n-1).select{|x| (n % x).zero?}
end

```
You have to return `factors` at the end of your `find_factors` method:

```
def find_factors(n)
  factors = []
  2.upto(n-1) {|x| factors << x if n % x == 0}
  factors
end

```