added scoring algorithm, not fully working