avg score funtion updated!