Please confirm I'm doing this correctly:

How many onto functions are there from a set with eight elements to a set with 3 elements?

Steps

1. There are $\displaystyle 3^8=6561$ functions total.

2. There are 3 functions with 1 element in range.

3. There are $\displaystyle 2^8-2$ functions with 2 elements in the range for each pair of elements in the codomain.

4. There are "3 choose 2"=3 ways to choose 2 elements from a set of 3.

5. Considering steps 1. through 4., the number of onto functions is:

$\displaystyle 3^8-(3*(2^8-2)+3)=5796$ onto functions

I'm almost positive this is correct. Could somebody please confirm?