We have developed a flexible version of the TIP4P model for molecular dynamics simulations. The model does a reasonable job of reproducing the experimental peak frequencies and widths of the bend and stretch peaks in the infrared spectra for both liquid H2O and D2O.