Working scoring mechanism. Removed superfluous comments.