implemented checkscore function