What is the function of denitrifying bacteria in the nitrogen cycle?