Block M (mass of 15.65 kg)

is initially moving to the left with a speed of 3.77 m/s. The mass of m is 8.26 kg and the coefficients of friction are Us = 0.411 and Uk = 0.304. The string is massless and the pulley is
massless and frictionless. How fast will M be traveling when m has fallen through a height h = 2.47 meters?

W=change in E
This is what I have done:
1/2Mvf^2-1/2Mvi^2+1/2mvf^2-1/2mvi^2-mgh-UkMg=0
I then solved for for vf. The answer is suppose to be 4.62 but I am way off. I need help fixing my set up.

To find the final velocity of block M when block m has fallen through a height h, you can use the principle of conservation of mechanical energy. Here's how you can fix your setup:

1. Identify the initial and final energy states:
- Initial energy: The initial kinetic energy of block M is given as 1/2Mvi^2, where M is the mass of block M and vi is its initial velocity. The initial potential energy of block m is mgh, where m is the mass of block m, g is the acceleration due to gravity, and h is the height through which block m has fallen.
- Final energy: The final kinetic energy of block M is 1/2Mvf^2, where vf is the final velocity of block M. The final potential energy of block m is zero since it has fallen to the ground.

2. Take into account the work done by friction:
- The work done by friction, denoted as -UkMg, contributes to the change in energy. The negative sign is used because friction acts in the opposite direction of motion.

3. Set up the equation for conservation of mechanical energy:
- Equate the initial energy to the final energy, considering the work done by friction:
1/2Mvi^2 + mgh - UkMg = 1/2Mvf^2

4. Rearrange the equation to solve for vf:
- Start by moving the terms involving vf to one side of the equation: 1/2Mvf^2 = 1/2Mvi^2 + mgh - UkMg
- Multiply both sides of the equation by 2 to eliminate the fractions: Mvf^2 = Mvi^2 + 2mgh - 2UkMg
- Divide both sides of the equation by M to obtain: vf^2 = vi^2 + 2(mgh - UkMg)
- Finally, take the square root of both sides to find vf: vf = √(vi^2 + 2(mgh - UkMg))

Plug in the given values for vi, M, m, g, h, and Uk into the equation to calculate the final velocity vf.