edited basic score function