A mass is sliding from a frictionless hill into a sliding board with friction, find work of friction Hey I have some I don't really understand here:

The mass m slides into the mass M $(m \neq M)$ which is a sliding board(it can move freely without friction from the ground). There is only friction between mass m and mass M.
What happens is the ball slides into the board, with beginning velocity of 
$v = \sqrt{2gh}$.
After a while the relative speed between the board and the ball is 0 ( they are still moving together in the same speed).
I think since the friction is relative to the board, so does the Work, that means that the final relative speed is 0 and the beginning relative speed is $mgh$ which means :
$W = \Delta E_{k} = 0 - mgh = -mgh$
I heard it's not correct but I don't know why, do I need to use Conservation of Momentum, but is there Conservation of Momentum with friction which is non conversative force?
in short :
1)Why am I wrong ?
2)Can I use Conversation of Momentum ? Does it exist here with the friction ?
 A: Ok so I found out the answer to my question so I'll answer it here :
1) The work energy relation is from an observational frame of reference, so to calculate the work the friction did, I need to calculate the kinetic energy difference between when the  friction just started applying and when it ended from an observational frame of reference.
Because it was the only force applied, the work done on the object m will be the work done by the friction.
2) to calculate the work I'll need final speed of the body which I'll get from conservation of momentum which does apply here because there are no external forces on the system. 
A: Momentum is always conserved within a closed system, even when there are  (internal) friction forces. The fact that the block $M$ slides freely makes $m, M$ a closed system from the time at which $m$ leaves contact with the ramp. 
When $m$ reaches the bottom of the slope it has momentum $mv$. Assuming that the mass $m$ eventually comes to rest on block $M$, then together they have momentum $(m+M)V$ where $V<v$ is their common final velocity. Momentum is conserved so $mv=(m+M)V$.
The work done against friction while the relative velocity between $m$ and $M$ was being reduced to zero is the loss of KE,which is $\frac12mv^2 - \frac12(m+M)V^2$.
A: The ball will reach the sliding mass M and start sliding on it's surface. Friction between the 2 will increase the speed of M (if it's free to move) and reduce the speed of ball relative to ground. At a certain time t speed of both of them would become equal (stopping relative motion) and then friction will stop acting.
There is no such thing as relative friction or relative force, it's called a pseudoforce. Also,conservation of momentum is valid as long as the external force on system is 0, which is true in this case.  
