How does the sentence end?

The nails were coming out of the wood and needed to be replaced with screws so the
screws were inserted.