my code from the ICFP 2006 programming contest