which of the following sentences contains a dangling modifier

1) playing with the children it was obvious they had a great time
2) the nurse arranged the medications on the tray talking to the doctor
3) in order to get good grades you need to apply yourself more in class
4) we spotted a curious scene filming the market last sunday

The correct sentence with a dangling modifier is:

2) the nurse arranged the medications on the tray talking to the doctor.

The subject of the main clause, "the nurse," is not the one performing the action described in the modifier, "talking to the doctor." A better way to fix this would be: "While talking to the doctor, the nurse arranged the medications on the tray."