def my_pos_in_box(pos, lbox):
    """ wrap positions inside simulation box

    Args:
      pos (np.array): positions, shape (natom, ndim)
      lbox (float): box side length
    Returns:
      np.array: pos in box
    """

    return -lbox / 2 + (pos - lbox / 2) % lbox