Added B functionality code