IR Detect example and not getting it..

Why do you have "int halfPeriod = 3;"? A half period of 38.5 kHz is about 13 microseconds, not 3.

Also, why do 70 cycles when there are 38.5 cycles per millisecond?