added scoring function for three sequences