Fixed the splitReference function to work according to Pdaddy's data. Fixed the values returned by calculate to be correct for hits and misses. Added print statements and a DEBUG define to control them.