Find a basis for the image and kernel of a linear transformation I'm having a bit of difficulty obtaining an answer to this problem. Specifically, finding a basis for the kernel of a transformation, $\ker(T)$ .

Let \begin{align*}
p_1(t)&=-1+t \\ 
p_2(t)&=-t+t^2 \\
p_3(t)&=-1+t^3, \quad\text{and}\\
p_4(t)&=2t-t^2-t^3.
\end{align*} Let $W=\operatorname{span}\{p_1,p_2,p_3,p_4\}$, a subspace of $\mathbf P_3$. 
Let $T: W \to \mathbf P_2$ be a linear transformation so that $T(p_i) = q_i$ where 
  \begin{align*}
q_1(t)&=-1+t+t^2 \\
q_2(t)&=2+4t-t^2 \\
q_3(t)&=1+11t+t^2 \quad\text{and}\\
q_4(t)&= -4-14t+t^2.
\end{align*} 
  
  
*
  
*Find a basis for $\operatorname{im}(T)$. The elements of this basis must be polynomials in $\mathbf P_2$.
  
*Find a basis for $\ker(T)$. The elements of this basis must be polynomials in $W$. 
  

I've been able to find (1) by taking the image of each element in $W$ (given by $q_1...q_4$) putting them into a matrix and row reducing to find the column space. Here I know that $\{q_1,q_2\}$ form a basis for $\operatorname{im}(T)$. 
However I'm having trouble with finding $\ker(T)$. I believe the next step is to find the null space of the matrix with vector columns of $q_1 \ldots q_4$, but I am not sure of this. The answer given is $g=-3p_1-2p_2+p_3$. This seems to come about if I find the null space of a matrix with columns $q_1 \ldots q_3$, but what about $q_4$? I am likely misunderstanding something here.
Thank you!
 A: Note that the columns of 
$$
A=
\left[\begin{array}{rrrr}
-1 & 0 & -1 & 0 \\
1 & -1 & 0 & 2 \\
0 & 1 & 0 & -1 \\
0 & 0 & 1 & -1
\end{array}\right]
$$
are identified with the polynomials $p_1$, $p_2$, $p_3$, and $p_4$. Row reducing gives
$$
\DeclareMathOperator{rref}{rref}\rref A=
\left[\begin{array}{rrrr}
1 & 0 & 0 & 1 \\
0 & 1 & 0 & -1 \\
0 & 0 & 1 & -1 \\
0 & 0 & 0 & 0
\end{array}\right]
$$
This tells us that $W$ is three-dimensional with basis $\{p_1,p_2,p_3\}$.
Now, note that the columns of 
$$
B=
\left[\begin{array}{rrrr}
-1 & 2 & 1 & -4 \\
1 & 4 & 11 & -14 \\
1 & -1 & 1 & 1
\end{array}\right]
$$
are identified with the polynomials $q_1$, $q_2$, $q_3$, and $q_4$. Row reducing gives
$$
\rref B=
\left[\begin{array}{rrrr}
1 & 0 & 3 & -2 \\
0 & 1 & 2 & -3 \\
0 & 0 & 0 & 0
\end{array}\right]
$$
This tells us that the image of $T$ is two-dimensional with basis $\{q_1,q_2\}$.
The rank-nullity theorem then implies that $\ker T$ is one-dimensional. To find a basis for $\ker T$, note that $\rref B$ tells us that the vector 
$$
\vec v=\left(1,\,4,\,1,\,2\right)
$$
is in the null space of $B$. This tells us that
$$
q_1+4\,q_2+q_3+2\,q_4=0
$$
It follows that
$$
T(p_1)+4\,T(p_2)+T(p_3)+2\,T(p_4)=0
$$
so that
$$
T(p_1+4\,p_2+p_3+2\,p_4)=0
$$
That is, the polynomial
$$
p_1+4\,p_2+p_3+2\,p_4=-t^3+2\,t^2+t-2
$$
forms a basis for $\ker T$.
