What yeast did you use? When I brewed this I used the Nottingham Ale Yeast which had an attenuation between 75-90%. If you used the Nottingham, with your OG of 1.040 you should expect an FG of between 1.010-1.004.
The formula is easy:
Attenuation % * OG = X then OG - X = Expected FG
.75*40= 30 then 40-30= 10 or 1.010
.90*40= 36 then 40-36 = 4 or1.004
If you used a different yeast, look of the expected attenuation % and recalculate. BTW, my FG ended up at 1.014 and the beer turned out great.