finished group_warping_bayes function