LineCalculator: Removed bugs, refactor