Updated scoring code