Implemented B calculation as actually described by the Stanford document. Updated unit test to reflect the divergence from rfc 5054.