<P> Tibbs initially suspects plantation owner Endicott, a racist who publicly opposes the new factory . When Tibbs attempts to interrogate Endicott, Endicott slaps him in the face and Tibbs slaps him back . Endicott sends a gang of hooligans after Tibbs . Gillespie rescues him from the fight and tells him to leave town for his safety, but Tibbs is convinced he can solve the case . He examines Colbert's body and suggests the murder happened earlier than initially thought . He examines Colbert's car and deduces that Colbert was murdered elsewhere and the culprit moved the body . Tibbs asks Wood to retrace his car patrol route on the night of the murder, and Gillespie joins them . When Tibbs notices that Wood has changed his route, Gillespie starts suspecting Wood, though Tibbs hints there is another reason . </P> <P> Gillespie discovers that Wood made a sizable deposit into his bank account the day after the murder while Purdy, a local, files charges against Wood for getting his 16 - year - old sister Delores pregnant . Gillespie arrests Wood, despite Tibbs' protests, and Delores is interrogated . Purdy is offended that a black man was present at the interrogation, and he gathers a mob to get revenge . Tibbs reveals that the murder was committed at the site of the planned factory and clears Wood . He also admits that he knew why Wood had changed his route: Delores is an exhibitionist and Wood has been spying on her . </P> <P> Tibbs visits a backstreet abortionist, who reveals that someone paid for Delores to have an abortion . When Delores arrives, Tibbs follows her outside and is confronted by the murderer, Ralph . Purdy's mob tracks down Tibbs and holds him at gunpoint; he responds by proving that Ralph got Delores pregnant . Ralph shoots Purdy dead before Tibbs disarms him . Ralph is arrested (presumptively for both murders) and confesses to Colbert's: he robbed Colbert to fund Delores's abortion but accidentally killed him . </P> <P> The final scene shows Tibbs boarding a train bound for Philadelphia, as Gillespie respectfully bids him farewell . </P>

Who was the murderer in the movie in the heat of the night