Added working score calculator
Refactoring