Updated to deal with N doctors