Code for model B of salamander data