modify motif scoring function to handle anbiguous nucleotides