codes for the 3BiM project