Two blocks, masses m1 and m2 are connected by an ideal string passing over an ideal pulley. One block is on a horizontal frictionless surface and the other can move vertically and only touches the string. Find the acceleration of each block and the tension in the string in terms of the masses and constants.