improved weighting scheme
added possible other way of computing prior
changed to the original data