Where was Francis Scott Key at the time of the Battle of Fort McHenry?

A.) On a British enemy ship
B.) In the nearby city, on the roof of his home
C.) On an American ship defending the fort
D.) Within the battlements of Fort McHenry