Fixes the broken unit test and BS calculation

Had some missing powers, incorrect signs and a square root. All in all a
pretty shoddy effort. Also added a unit test to ensure that the calculation
returns the correct result.