Added typechecking to wilson_score