Hal Petersham was the one who poisoned Dexter Cornell. He was jealous of how naturally talented Dexter was in making novels. And when he discovered high schooler Nick Lang had the same 'gift' in creative writing, he decided to steal Nick's story; 'out of whack' and pass it off as he's own. That meant killing off everyone who knew different...hence the murders. When Hal tries to drop a typewriter on Dex's head he is shot by Dex with Cookie's gun (she was accidentally shot dead by Bernard who was then chucked into the tar pits by Dex...thus burying him alive) and crashes out of a window to his demise on the school yard below (landing on the exact spot where Nick fell onto).