The previous refactoring doesn't work because the return value of the new method wa declared "int" and it should have been "double" Make this change... compile, test... all is well.