Added bar calculator and tests.