The block of mass m in the following figure slides on a frictionless surface

The block of mass M slides on a frictionless surface. It is attached to a string that goes over a frictionless and massless pulley. Attached to the opposite end of the string is a mass m hanging freely. Find an expression for the tension in the string.