Help with distributive property

Hey I was doing a math problem and needed help with one certain part near the end of the problem. Here is the problem and what I have done already:

8(1/x-7)=9(1/x)+3(1/5x)

8/x-7=9/x+3/5x

then I multiply each side by the least common denominator. I understand what to do on the left hand side, I just don't understand how to distribute the x-7 on the right (I assume the 5x gets canceled out:

5x(x-7)*(8/x-7) = (9/x+3/5x)*5x(x-7)

40x=(9/x+3)*(x-7)

Any help would be greatly appreciated!!!! I'm really frustrated! I know the answer is 48x-336 but I can't see how to get there!