Added Arend Dijkstra's code in such way it compiles. Names of some
variables were changed so that the code compiles.