Code for BeAMate