edited scoring algorithm