Joel and Mcfarland had a total of 360 buttons. Joel gave 1/5 of his buttons to Mcfarland. Mcfarland gave 1/4 of his buttons to Joel. In the end, each of them had the same number of buttons. How many buttons did Joel have at first?

J's buttons ---- x

M's buttons ----- 360-x

after the great give-away:
J had (4/5)x + (1/4)(360-x)
M had (3/4)(360-x) + (1/5)x

(4/5)x + (1/4)(360-x) = (3/4)(360-x) + (1/5)x
times 20
16x + 5(360-x) = 15(360-x) + 4x
16x + 1800 - 5x = 5400 - 15x + 4x
22x = 3600
x = 1800/11 <----- not a whole number as it should

2 possibilities:
1. I made an error
2. the question is flawed