rewrite score_pos to be easier to modify