Adding a crystal, you have to change the bits of course, to enable external oscillator crystal instead of internal oscillator. You also need the small capacitors on each leg to ground, around 22pF to 27pF in most cases. Make sure the frequency declaration in the code matches the crystal frequency.