See Phred's excellent tutorial here.