Setting application root
Updating logic to return the calculated score.

It's getting late, this code is in need of some serious refactoring