gdh2 algorithm implemented (both lib and test)