Thought I'd also have a go at translating ch-1.pl into C..