First working C++ version completed. Much faster.