finished B functionality