rev.B with few vital fixes