Implementation uses only C++ and C++ standard library. Just for fun.