compute word scores