Which sentence is constructed so that the modifier clearly describes the words for which it was intended?

A: The teacher designed a new workbook for students who failed three tests for a very good reason.
B: For a very good reason, the teacher designed a new workbook for students who failed three tests.