Improved scoring script.