modified the BX method