Model: Added the way algorithm + UnitTest. Now only refactoring.