[Arduino Mega1280] frequency counter

Hi i found library for frequency counter:

http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/

But it use 3 pin in. I need someone who help me rewrite this library to use with this comparator:

And it is not the end i need to count 2 frequency. I have 2 comparator and need to read 2 frequency.

Sorry, for my poor english.

Please help me at forum or e-mail: ilewy.mac@gmail.com