fixed indexing issues in dp_bayes