added some scoring code