more work on iterative bayes, added badlags masks, probability probably not working correctly