The D40 and D40x have focus systems that do not have as many AF squares as the D5500...I think you'll find that a D5500 has like, a decade newer AF system and a decade-newer level of focus capability!
Right.. So it's hard when my subject is on the left or right side and it only wants to focus in the center.. I've messed with the AF options but it tends to do what it wants
I shot a few thousand shots on my then-wife's D40...I know exactly what you mean, but in the more than a decade time span between the D40 series and the D5500, NIkon's autofocusing systems have become much,much better on the entry-level cameras. It's hard to fathom until you actually compare old against new: the D40 series had THREE AF squares...left,center,right, and each one was fairly big too!
The D5500 has 39 AF squares, and 9 are cross-type. The D5500 has touch screen, and tap-to-focus capability as well.
Nikon D5500 Review