Finished the update of the score card.
Removed a uneeded sql function.