Calculate score in a function, so we can easily switch between score metrics. Also, remove old code.