bead arithmetic