changed dp_bayes to a function, continued writing of pair alignment function