The ages of moe and joe now total 49 years.
M+J = 49
Moe's age now is twice the age that joe was...
Stop here. Let y = the number of years ago that was.
y years ago, Moe was M-y and Joe was J-y
M = 2(J-y)
Now let's see what else was true y years ago:
...when moe's age was the same as joe's is now.
M-y = J
So we have these three equations:
M+J = 49
M = 2*(J-y)
M-y = J
Solve that system of equations and get J=21, M=28, y=7
Edwin