Code restyled and one bug fix (B1 -> cB1).