Extracted methods for calculations
Added several tests, extracted calculation logic to separate class
Previous part 2