C++-ified source. Compilation ok but program must be checked.