Score calculation

Now can calculate scores. Have not verified accuracy yet though.