Added score function to calculations