Finish implementation of C++ entropy (untested)