Changed the dispatching of calculations of zeroes

Tried to improve on naming and organization of code. All tests pass.