Tail recursion optimization
Convergence chart plotting due to scala-chart library