given that f(x)=$\displaystyle x^3+kx^2-2x+1$ and when f(x) is divided by (x-k) the remainder is k. find the possible values for k.

i have $\displaystyle k^3+k(k)^2-kx+1= k $

$\displaystyle 2k^3 - 2k+1 = k$

am stuck here. i know that (k-1) is a factor but i get a reaminder when i divide the equation by it,

may i get some help with this?